package com.kaifamiao.io.d0921;

import java.io.*;

public class Copy {

    public static void main(String[] args) {
        String source = "D:\\workspace\\idea_workspace_kfm4\\demo\\html\\d0909\\other\\zjmnk.m4a";
        String target = "d:\\io\\zjmnk.m4a";
        try(FileInputStream fis = new FileInputStream(source);
            FileOutputStream fos = new FileOutputStream(target)){

//            byte[] bytes = new byte[1024];
//            int len = -1;
//            while( (len = fis.read(bytes)) != -1){
//                fos.write(bytes, 0, len);
//            }

//            byte[] bytes = fis.readAllBytes();
//            fos.write(bytes);

            fis.transferTo(fos);

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
